<?php

namespace app\ow_test\controller;


use think\Controller;
use think\Db;
use think\response\Json;

class ow extends Controller
{

    public function Ow()
    {

        //var_dump("111");die;

        return view("ow");
    }


    public function province()
    {

        //1.首先抽出省级的数据，在通过点击省级数据得到相应的市级数据，在由市级数据得到，区级的数据
        $province = Db::table('province')->select();

//        var_dump($province);die;
        return \json($province);
    }


    public function city()
    {
        $id = $this->request->post();

        $city = Db::table('city')->where(['province_id'=>$id])->select();
//          var_dump($city);die;
        return \json($city);

    }



    public function area(){

        $id = $this->request->post();

        $area = Db::table('area')->where(['city_id'=>$id])->select();
//          var_dump($city);die;
        return \json($area);

    }


}